﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>客户信息</title>
<link href="../css/novaui.css" rel="stylesheet"/>
<!--jqeury tab plugin-->
<link href="../css/kandytabs.css" rel="stylesheet"/>
<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.0.6-development-only.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.js"></script>
<!--jquery tab plugin-->
<script src="../js/kandytabs.pack.js"></script>
<link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css"/>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.js"></script>
<script src="../js/public.js"></script>
<script src="../js/xdate.js"></script>
</head>
<body>
<div class="wrap">
 <h2 class="section-title">
	<span class="icon icon-basic"> </span>
	新建计划<a class="map" name="client-basicInfo"></a> <span class="control-slide">点击折叠</span> </h2>
  <div class="section-con">
    <dl class="form">
      <dt>计划名称：</dt>
      <dd><input name="" type="text"></dd>
      <dt>额度：</dt>
      <dd><input name="totleNumber" id="totleNumber" type="number" value="100200"></dd>
      <dt>开始日期：</dt>
      <dd><input name="" type="text" id="startDate" value="2011-12-15"></dd>
       <dt>结束日期：</dt>
      <dd><input name="" type="text" id="endDate" value="2012-04-15"></dd>
       <dt>计划子项：</dt><dd> <div id="input">
     12月(16天) <input name="" type="text" id="m1"><br>
1月 <input name="" type="text" id="m2"><br>
2月<input name="" type="text" id="m3"> <br>
3月<input name="" type="text" id="m4"> <br>
4月<input name="" type="text" id="m5">
      </div>
      <div id="text"></div></dd>
      <div class="buttons"><input name="" type="button" value="平均分配"></div>
    </dl>
  </div>
  <!--/客户基础信息-->
  <!--客户工商信息--><!--/客户工商信息-->
</div>
<!--/.wrap-->
<script>
var totleNum=$("#totleNumber").val();
var startDate=new XDate($("#startDate").val())
var endDate=new XDate($("#endDate").val())
var totleDate=startDate.diffDays(endDate)
var n1=XDate.getDaysInMonth(startDate.toString("yyyy"),startDate.toString("M"))-startDate.toString("d")
var n2=XDate.getDaysInMonth(startDate.addMonths(1).toString("yyyy"),startDate.toString("M")-1)
var n3=XDate.getDaysInMonth(startDate.addMonths(1).toString("yyyy"),startDate.toString("M")-1)
var n4=XDate.getDaysInMonth(startDate.addMonths(1).toString("yyyy"),startDate.toString("M")-1)
var n5=XDate.getDaysInMonth(startDate.addMonths(1).toString("yyyy"),startDate.toString("M")-1)
var em=Math.ceil(totleNum/totleDate)
var html="该计划总共:"+totleDate+"天<br>"
    html+="计划总额度:"+totleNum/10000+"万元<br>"
	html+="平均每天:"+em+"元(舍去数点)<br>"+n1+"/"+n2+"/"+n3+"/"+n4+"/"+n5+"/"+startDate.toString("yyyy-M-d")
	
$("#text").html(html)
$("#m1").val(n1*em)
$("#m2").val(n2*em)
$("#m3").val(n3*em)
$("#m4").val(n4*em)
$("#m5").val(n5*em)
</script>
</body>
</html>
